from collections import defaultdict
while True:
    try:
        a = input()
        if a == 'exit':
            print("退出成功")
            break
        #使用缺省字典,记录字符出现次数
        dd = defaultdict(int)
        for i in a:
            dd[i] += 1
        for i in dd:
            #出现最少的字符 ""替换
            if dd[i] == min(dd.values()):
                a = a.replace(i, "") # 替换和移除差不多
        print(a)
    except:
        break
